package com.ihtry.service.impl;

import com.ihtry.dao.BookDao;
import com.ihtry.pojo.Book;
import com.ihtry.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookDao bookDao;

    public boolean addBook(Book book) {
        return bookDao.addBook(book);
    }

    public boolean deleteBook(Integer id) {
        return bookDao.deleteBook(id);
    }

    public boolean updateBook(Book book) {
        return bookDao.updateBook(book);
    }

    public List<Book> getAll() {
        return bookDao.getAll();
    }

    public Book getBookById(Integer id) {
        return bookDao.getBookById(id);
    }
}
